package main

import "fmt"

func main() {
	a := []byte{'a', 'b', 'c'}
	b := []byte{'a', 'b', 'd'}
	compare := Compare(a, b)
	fmt.Println("compare : ", compare)

}

func Compare(a, b []byte) int {
	for i := 0; i < len(a) && i < len(b); i++ {
		switch {
		case a[i] > b[i]:
			return 1
		case a[i] < b[i]:
			return -1
		}
	}
	switch {
	case len(a) < len(b):
		return -1
	case len(a) < len(b):
		return 1

	}
	return 0
}
